package com.bcbim.smart_water.maintenance.service;

import com.bcbim.common.sys.Code;
import com.bcbim.smart_water.maintenance.mapper.MaintenanceMapper;
import com.bcbim.smart_water_interface.health.dto.HealthMaintenanceDTO;
import com.bcbim.smart_water_interface.health.vo.HealthMaintenanceVO;
import com.bcbim.smart_water_interface.maintenance.dao.MaintenanceDAO;
import com.bcbim.smart_water_interface.maintenance.dto.MaintenanceDTO;
import com.bcbim.smart_water_interface.maintenance.service.MaintenanceService;
import com.bcbim.smart_water_interface.maintenance.vo.ListMaintenanceVO;
import com.bcbim.smart_water_interface.maintenance.vo.MaintenanceVO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Description: 养护数据列表service实现类
 * @Author XueHao
 * @Date 2021/8/26
 * @Version V1.0
 **/
@Service(timeout = 60 * 1000, group = "maintenance", version = "1.0.0")
public class MaintenanceServiceImpl implements MaintenanceService {
    @Autowired
    private MaintenanceMapper maintenanceMapper;

    /**
     * @Description 新增养护数据
     * @Author XueHao
     * @Date 2021/8/26
     * @return int
     */
    @Override
    public int insertMaintenance(MaintenanceDAO maintenanceDAO) {
        return maintenanceMapper.insertMaintenance(maintenanceDAO);
    }
    
    /**
     * @Description 更新养护数据
     * @Author XueHao
     * @Date 2021/8/26 
     * @return int
     */
    @Override
    public int updateMaintenance(MaintenanceDAO maintenanceDAO) {
        return maintenanceMapper.updateMaintenance(maintenanceDAO);
    }

    /**
     * @Description 删除养护数据
     * @Author XueHao
     * @Date 2021/8/26
     * @return int
     */
    @Override
    public int removeMaintenance(MaintenanceDAO maintenanceDAO) {
        return maintenanceMapper.updateMaintenance(maintenanceDAO);
    }

    /**
     * @Description 查询养护数据条数
     * @Author XueHao
     * @Date 2021/8/26
     * @return int
     */
    @Override
    public int countListMaintenance(MaintenanceDTO maintenanceDTO) {
        return maintenanceMapper.countListMaintenance(maintenanceDTO);
    }

    /**
     * @Description 查询养护数据列表
     * @Author XueHao
     * @Date 2021/8/26
     * @return List<MaintenanceVO>
     */
    @Override
    public List<ListMaintenanceVO> listMaintenance(MaintenanceDTO maintenanceDTO) {
        return maintenanceMapper.listMaintenance(maintenanceDTO);
    }

    /**
     * @Description 查询管点详情
     * @Author XueHao
     * @Date 2021/8/26
     * @return MaintenanceVO
     */
    @Override
    public MaintenanceVO getMaintenance(String id) {
        return maintenanceMapper.getMaintenance(id);
    }

    /**
     * @Description 管点编号下拉
     * @Author XueHao
     * @Date 2021/8/27
     * @return List<Code>
     */
    @Override
    public List<Code> selectLineCode(String code) {
        return maintenanceMapper.selectLineCode(code);
    }

    /**
     * @Description 执行人下拉列表
     * @Author XueHao
     * @Date 2021/8/27
     * @return List<Code>
     */
    @Override
    public List<Code> selectExecutor() {
        return maintenanceMapper.selectExecutor();
    }

    /**
     * @Description: 健康检测 养护信息总数
     * @Param: HealthMaintenanceDTO
     * @Return: int
     * @Author: ye
     * @Date: 2021/8/30
     */
    @Override
    public int countHealthMaintenance(HealthMaintenanceDTO query) {
        return maintenanceMapper.countHealthMaintenance(query);
    }

    /**
     * @Description: 健康检测 养护信息
     * @Param: HealthMaintenanceDTO
     * @Return: List<HealthMaintenanceVO>
     * @Author: ye
     * @Date: 2021/8/30
     */
    @Override
    public List<HealthMaintenanceVO> listHealthMaintenance(HealthMaintenanceDTO query) {
        return maintenanceMapper.listHealthMaintenance(query);
    }
}
